package edu.hziee.controllers;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/")
public class HomeController {

	@RequestMapping(method = RequestMethod.GET)
	public String home(HttpSession session){
		if( session.getAttribute("user") == null){
			return "redirect:/login";
		}
		else
			return "redirect:/blog";
	}
}
